import request from '@/utils/request'

// 查询美团树形结构列表
export function listTree(query) {
  return request({
    url: '/business/tree/list',
    method: 'get',
    params: query
  })
}

// 查询美团树形结构详细
export function getTree(id) {
  return request({
    url: '/business/tree/' + id,
    method: 'get'
  })
}

// 新增美团树形结构
export function addTree(data) {
  return request({
    url: '/business/tree',
    method: 'post',
    data: data
  })
}

// 修改美团树形结构
export function updateTree(data) {
  return request({
    url: '/business/tree',
    method: 'put',
    data: data
  })
}

// 删除美团树形结构
export function delTree(id) {
  return request({
    url: '/business/tree/' + id,
    method: 'delete'
  })
}

// 新增属性
export function addAttribute(data) {
  return request({
    url: '/business/attribute',
    method: 'post',
    data: data
  })
}

// 查询属性
export function getAttribute(id) {
   return request({ 
    url: '/business/attribute/' + id, 
    method: 'get' 
  }) 
}
